"""
@File    :   out.py
@Time    :   2024/04/13 16:40:58
@Author  :   Qrj
@Email   :   923207736@qq.com
@description   :   字典类型相关的pydantic序列化模型
"""

from datetime import datetime

from pydantic import BaseModel, Field, TypeAdapter

from src.schemas.out import BaseOutSchemaConfigMixin


class DictTypeCompleteOutSchema(BaseModel, BaseOutSchemaConfigMixin):
    """字典类型完整的序列化模型"""

    id: int = Field(default=..., description="主键")
    name: str = Field(default=..., description="字典名称")
    type: str = Field(default=..., description="字典类型")
    status: bool = Field(default=..., description="状态")
    remark: str = Field(default=..., description="备注")
    show_order: int = Field(default=..., description="显示顺序")
    create_datetime: datetime = Field(default=..., description="创建时间")
    update_datetime: datetime = Field(default=..., description="修改时间")
    creator_username: str = Field(default=..., description="创建者")
    updater_username: str = Field(default=..., description="修改者")


# 字典类型完整的列表序列化模型
ListDictTypeCompleteOutSchema = TypeAdapter(list[DictTypeCompleteOutSchema])
